using UnityEngine;

public class Table
{
	public static float length { get; protected set; }

	public static float width { get; protected set; }

	public static float halfwidth { get; protected set; }

	public static float tabletopy { get; protected set; }

	public static float netHeight { get; protected set; }

	public static float halfLength { get; protected set; }

	public static Plane tablePlane { get; protected set; }

	static Table()
	{
		length = 2.74f;
		width = 1.5105f;
		tabletopy = 0.761915f;
		netHeight = 0.14245f;
		halfLength = length * 0.5f;
		halfwidth = width * 0.5f;
		tablePlane = new Plane(Vector3.up, new Vector3(0f, tabletopy, 0f));
	}

	public static bool IsPosOnTable(Vector3 pos)
	{
		return Mathf.Abs(pos.x) <= halfwidth && Mathf.Abs(pos.z) <= halfLength;
	}

	public static bool IsNetHit(float heightOverNet)
	{
		return heightOverNet < tabletopy + netHeight;
	}
}
